﻿<UserControl x:Class="nRoute.Themes.AboutError"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
	xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:nBehaviors="clr-namespace:nRoute.Behaviors" 
	xmlns:nComponents="clr-namespace:nRoute.Components" 
	xmlns:nNavigation="clr-namespace:nRoute.Navigation" 
	nNavigation:Navigation.Title="Navigation Problem"
    d:DesignHeight="800" d:DesignWidth="480">


    <UserControl.Resources>
        <nComponents:ValueConverterRelay x:Key="TitleConverterRelay" />
        <nComponents:ValueConverterRelay x:Key="SubTitleConverterRelay" />
        <nComponents:ValueConverterRelay x:Key="ReturnUrlConverterRelay" />
        <nComponents:ValueConverterRelay x:Key="RetryUrlConverterRelay" />
    </UserControl.Resources>

    <StackPanel x:Name="LayoutRoot" Background="{StaticResource PhoneBackgroundBrush}">
    	
        <!--TitleGrid is the name of the application and page title-->
		<TextBlock Text="{Binding ResponseStatus, Converter={StaticResource TitleConverterRelay}, Mode=OneWay}"
			Style="{StaticResource PhoneTextPageTitle2Style}"  HorizontalAlignment="Left" TextWrapping="Wrap" Margin="12,10,0,0" FontSize="48" Foreground="{StaticResource PhoneAccentBrush}"/>

		<ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto" VerticalContentAlignment="Top" 
			BorderThickness="0" BorderBrush="{x:Null}">
			
			<StackPanel d:LayoutOverrides="Width" Margin="12,0,12,0">
				<StackPanel.Background>
					<ImageBrush Stretch="Fill"/>
				</StackPanel.Background>
				
	        	<TextBlock x:Name="SubTitleText" TextWrapping="Wrap" FontSize="26.667" 
					Margin="0,6,0,10" Foreground="{StaticResource PhoneForegroundBrush}" 
	                Text="{Binding ResponseStatus, Converter={StaticResource SubTitleConverterRelay}, Mode=OneWay}"/>
	            
	        	<TextBlock x:Name="ErrorMessageText" Foreground="{StaticResource PhoneForegroundBrush}" 
					Text="{Binding Error.Message, Mode=OneWay}" 
					TextWrapping="Wrap" Margin="0,0,0,10" FontSize="26.667">
	        		<i:Interaction.Behaviors>
	        			<nBehaviors:NullValueVisibilityBehavior ValueBinding="{Binding Error, Mode=OneWay}"/>
	        		</i:Interaction.Behaviors>
	        	</TextBlock>

                <TextBlock x:Name="NavigateReturnText" Cursor="Hand" HorizontalAlignment="Left" Margin="0,0,0,10" 
					VerticalAlignment="Bottom" Text="{Binding RefererRequest, Converter={StaticResource ReturnUrlConverterRelay}, Mode=OneWay}" 
					TextDecorations="Underline" Foreground="{StaticResource PhoneForegroundBrush}"  MouseLeftButtonUp="Link_NavigateReturn" 
                    FontSize="26.667" TextWrapping="Wrap">
	        		<i:Interaction.Behaviors>
	        			<nBehaviors:NullValueVisibilityBehavior ValueBinding="{Binding RefererRequest, Mode=OneWay}"/>
	        		</i:Interaction.Behaviors>
	        	</TextBlock>
				
	            <TextBlock x:Name="NavigateRetryText" Cursor="Hand" HorizontalAlignment="Left" Margin="0,0,0,10" 
					VerticalAlignment="Bottom" Text="{Binding Request, Converter={StaticResource RetryUrlConverterRelay}, Mode=OneWay}" 
					TextDecorations="Underline" Foreground="{StaticResource PhoneForegroundBrush}"	 MouseLeftButtonUp="Link_NavigateRetry" FontSize="26.667" TextWrapping="Wrap">
					<i:Interaction.Behaviors>
						<nBehaviors:NullValueVisibilityBehavior ValueBinding="{Binding Request, Mode=OneWay}"/>
					</i:Interaction.Behaviors>
                </TextBlock>

                <TextBlock x:Name="NavigateBackText" Cursor="Hand" HorizontalAlignment="Left" Margin="0,0,0,10" 
					VerticalAlignment="Bottom" Text="Navigate Back" 
					TextDecorations="Underline" Foreground="{StaticResource PhoneForegroundBrush}"  MouseLeftButtonUp="Link_NavigateBack" 
                    FontSize="26.667" TextWrapping="Wrap">
	        		<i:Interaction.Behaviors>
	        			<nBehaviors:NullValueVisibilityBehavior ValueBinding="{Binding DirectionalNavigationHandler, Mode=OneWay}"/>
	        		</i:Interaction.Behaviors>
                </TextBlock>

                <TextBlock x:Name="MoreInfoText" Cursor="Hand" HorizontalAlignment="Left" VerticalAlignment="Bottom" 
					Text="Click for Error Details" Margin="0,0,0,10" TextDecorations="Underline"					
					Foreground="#FF73A9D8" FontSize="26.667" TextWrapping="Wrap">
	        		<i:Interaction.Behaviors>
	        			<nBehaviors:NullValueVisibilityBehavior ValueBinding="{Binding Error, Mode=OneWay}"/>
	        		</i:Interaction.Behaviors>
	        		<i:Interaction.Triggers>
	        			<i:EventTrigger EventName="MouseLeftButtonUp">
	        				<nBehaviors:TargetedSetPropertyAction TargetName="textBox" 
								PropertyName="Visibility" Value="Visible"/>
	        			</i:EventTrigger>
	        		</i:Interaction.Triggers>
	        	</TextBlock>
				
	        	<TextBox x:Name="textBox" Text="{Binding Error, Mode=OneWay}" TextWrapping="Wrap" 
					Height="150" AcceptsReturn="True" IsReadOnly="True" BorderThickness="1" 
					BorderBrush="{StaticResource PhoneTextBoxBrush}" VerticalScrollBarVisibility="Visible" Background="{StaticResource PhoneTextBoxBrush}" 
					Visibility="Collapsed" FontSize="26.667" Foreground="{StaticResource PhoneContrastForegroundBrush}"/>
					
	        </StackPanel>
			
		</ScrollViewer>
    </StackPanel>

</UserControl>
